Many programming languages, including graphical and/or textual programming languages, offer support for object-oriented programming. Even languages not historically designed for object-oriented programming, such as, for example, C, may be adapted for some or all of the object-oriented programming concepts, such as, for example, inheritance, encapsulation, polymorphism, etc.
Object oriented programming typically involves defining one or more classes, which may be instantiated during execution of program code. In object-oriented programming, an instantiation of a class is referred to as an “object.” Multiple objects may be instantiated from a single class. A class may define standard characteristics of objects that may be instantiated from it. Such characteristics may include attributes, such as fields or properties an object may have, and methods—things that an object is capable of doing. For example, if a class defines a property “a,” different objects—different instances of that class—may have different values for “a.” Similarly, if a class defines a method “do_a,” all objects of that class will be able to execute the method “do_a” on the appropriate input.
Object-oriented programming may involve class inheritance, where one class (often referred to as a “subclass” or a “child class”) “inherits” from another class—that is, extends the characteristics of that class. The class from which a subclass inherits is referred to as a “parent class” or a “super-class.” Inheritance may involve adding characteristics such as methods or properties, or specializing the existing characteristics of a class definition. There may be multiple levels of inheritance—that is, a subclass may be a super-class for another subclass and so on. Some languages allow for multiple-inheritance, where a subclass may inherit from two or more classes at once.
In some languages, there may be some differences between built-in constructs, such as, for example, literals (values, such as numbers, specific strings, etc.), and/or primitive variable types, etc. and objects. In other languages, all constructs may be treated as equal. The differences or lack thereof may show up in the way different constructs are referred to, and/or the way they are used, what operations may be possible on them, how they are treated by compilation or execution engines, etc. In some languages, objects may have references or “pointers” pointing to them. Objects may be accessed through pointers or through other means. In some cases, values of variables in an object may be modified using appropriate syntax on a pointer. In other cases, a language may have a concept of an object separate from its pointer. In yet other cases, mixed usage may be allowed.
Programming languages may have various characteristics, such as being compiled and/or interpreted, statically typed and/or dynamically typed, textual and/or graphical, etc. In addition to the variety of programming languages available, there is a large variety of tools that a programmer may use to develop, review, analyze, test, and/or execute program code. For example, code may be written in an editor—anything from a simple text editor, to specialized program code editors, analyzed and/or tested by hand or by automated tools, such as static checkers, automatic test suits, etc., and executed directly in an operating system environment or in a specialized compile-based or interpretive environment.
There may be tools assisting programmers in various code development stages, such as, for example, integrated development environments (IDEs) that allow programmers to write and compiled and/or test their code. Alternatively, there may also be programming environments that allow for development and execution of code. One such programming environment is the MATLAB® programming environment from The MathWorks, Inc. of Natick, Mass. The MATLAB® programming environment supports a dynamically typed array-based language, referred to as MATLAB code herein.